﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Yipusoft.BaseDoc.Model;

public partial class Task_BaseDoc_DocumentReName : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            Bind();
    }
    private void Bind()
    {
        if (Request["ID"] == null || Request["ID"] == Guid.Empty.ToString())
        {
            Response.Write("<script>history.back(0);</script>");
            return;
        }
        txtFileName.Text = Yipusoft.BaseDoc.BLL.FileManager.GetFile(new Guid(Request["ID"])).OldFileName;


    }
    protected void btnModify_Click(object sender, EventArgs e)
    {
        lblPrompt.Text = "";
        if (string.IsNullOrEmpty(txtFileName.Text.Trim()))
        {
            lblPrompt.Text = "请输入文件名";
            return;
        }
        DocumentFileInfo info = Yipusoft.BaseDoc.BLL.FileManager.GetFile(new Guid(Request["ID"]));
        info.OldFileName = txtFileName.Text;
        info.EndDate = DateTime.MaxValue;
        Yipusoft.BaseDoc.BLL.FileManager.UpdateDocumentFileInfo(info);
        lblPrompt.Text = "修改已成功";
    }
}
